/**
 * All rights reserved by DigitNexus Technology INC.
 */
package com.xspace.android.xafview.zxing;

import android.content.Context;
import android.content.SharedPreferences;

public class ZxingPreferences {
	private SharedPreferences mCfgPrf;
	private static ZxingPreferences instance;
	private  final String CONFIG_PERFER = "preferencesdata";
	public ZxingPreferences(Context context) {
		mCfgPrf = context.getSharedPreferences(CONFIG_PERFER,
				Context.MODE_WORLD_READABLE | Context.MODE_WORLD_WRITEABLE
						| Context.MODE_PRIVATE);
	}
	public static ZxingPreferences getInstance(Context context){
		if(instance == null){
			instance = new ZxingPreferences(context);
		}
		return instance;
	}
	//write boolean
	public  void setPfBoolean(String name,boolean flag) {
		mCfgPrf.edit().putBoolean(name, flag).commit();
	}

	// get boolean
	public  boolean getPfBoolean(String name) {
		return mCfgPrf.getBoolean(name, true);
	}
	
}
